<?php

namespace Home\Model;
use Think\Model;

class BookModel extends Model{
    //put your code here
    
    
    public function _after_find($param) {
        
    }
    
    public function _after_select(&$records,$options) {
        foreach ($records as &$value) {
            if(!empty($value['tid'])){
                $type = D('Type')->find($value['tid']);
                $value['name'] = $type['name'];
            }else{
                $value['name'] = '一周最新';
            }
            if(empty($value['author'])){
                $value['author'] = '长风';
            }
        }
    }
}
